<template>
    <el-dialog :visible.sync="dialogVisible" title="查询次数" width="800px">
        <el-table v-loading="listLoading" :data="tableData.data" style="width: 100%" size="small">
            <el-table-column align="center" label="序号" type="index" width="80"></el-table-column>
            <el-table-column align="center" label="用户ID" prop="userId"></el-table-column>
            <el-table-column align="center" label="用户昵称" prop="nickname"></el-table-column>
            <el-table-column align="center" label="用户手机号" prop="phoneNumber"></el-table-column>
            <el-table-column align="center" label="查询状态" prop="">
                <template slot-scope="scope">
                    <el-tag size="mini" type="success">正常</el-tag>
                    
                </template>
            </el-table-column>
            <el-table-column align="center" label="查询时间" prop="queryTime"></el-table-column>
        </el-table>
        <el-pagination class="pageRight" background layout="total, sizes, prev, pager, next, jumper"
            :page-sizes="[10, 20, 50, 100]" :page-size="searchForm.pageSize" :total="tableData.total"
            @size-change="handleSizeChange" @current-change="handleCurrentChange"></el-pagination>
    </el-dialog>
</template>

<script>
import {getBrokerageQueryCount} from '@/api/brokerage'
export default {
    data() {
        return {
            dialogVisible: false,
            searchForm: {
                pageNum: 1,
                pageSize: 10,
                enterpriseId: ''
            },
            listLoading: false,
            tableData: {
                data: [],
                total: 0
            }
        };
    },
    methods: {
        open(v) {
            this.searchForm.enterpriseId = v.enterpriseId;
            this.dialogVisible = true;
            this.getList();
        },
        handleClose() {
            this.dialogVisible = false;
        },
        getList() {
            this.listLoading = true;
            getBrokerageQueryCount(this.searchForm).then(res => { 
                this.tableData.data = res.data.list;
                this.tableData.total = res.data.total;
            }).finally(()=> {
                this.listLoading = false;
            });

        },
        handleSizeChange(val) {
            this.searchForm.pageSize = val
            this.getList()
        },
        handleCurrentChange(val) {
            this.searchForm.pageNum = val
            this.getList()
        },
    }
}
</script>

<style></style>